const router = require('koa-router')();
const food = require('../modules/food');

//获取数据
router.get('/city/food',async(ctx,next) => {
    ctx.body = await food.getFood();
  })
//增加数据
router.post('/city/food',async(ctx,next) => {
    ctx.body = await food.addFood(ctx.request.body);
})

//删除数据
router.delete('/city/food/:foodID/:cityID',async(ctx,next) => {
    ctx.body = await food.deleteFood(ctx.params);
})
//更改数据
router.put('/city/food',async(ctx,next)=>{
    ctx.body = await food.putFood(ctx.request.body)
})
module.exports = router;
